<template>
	<view class="c-container no-border c-container-item" id="wedding">
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">执行公司</view>
				<view class="col-text">{{ wedding.company }}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">婚庆总价</view>
				<view class="col-text">{{ wedding.wedding_totals }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">婚庆套餐</view>
				<view class="col-text">{{ checkObjLength(wedding.wedding_package) ? wedding.wedding_package.title : '无' }}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">套餐金额</view>
				<view class="col-text">{{ wedding.wedding_package_price }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">婚庆仪式</view>
				<view class="col-text">{{ wedding.wedding_ritual }}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">仪式价格</view>
				<view class="col-text">{{ wedding.wedding_ritual_hall }}</view>
			</view>
		</view>
		<view class="c-row" v-if="wedding.is_new_product == 1">
			<view class="c-row-col">
				<view class="col-title">是否研发产品</view>
				<view class="col-text">是</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">研发产品编号</view>
				<view class="col-text">{{ wedding.new_product_no }}}</view>
			</view>
		</view>
		<view class="c-row" v-if="wedding.wedding_remark">
			<view class="c-row-col">
				<view class="col-title">备注</view>
				<view class="col-text col-remark">{{ wedding.wedding_remark }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">审核状态</view>
				<view class="col-text col-remark" :style="{ color: status[wedding.item_check_status].color }">{{ status[wedding.item_check_status].title }}</view>
			</view>
		</view>
	</view>
</template>

<script>
import { getSwiperMaxHeight } from '@/utils/funs.js';
import { checkObjLen } from '@/utils/common.js';

export default {
	props: {
		parent: {
			type: Object,
			default() {
				return {};
			}
		},
		wedding: {
			type: Object,
			default() {
				return {};
			}
		}
	},
	data() {
		return {
			swiperHeight: 0,
			status: {
				0: {
					title: '待审核',
					color: '#999'
				},
				1: {
					title: '审核中',
					color: '#999'
				},
				2: {
					title: '审核通过',
					color: '#409EFF'
				},
				3: {
					title: '审核驳回',
					color: 'red'
				},
				13: {
					title: '已撤销',
					color: '#999'
				}
			}
		};
	},
	beforeMount() {
		this.getSwiperMaxHeight = getSwiperMaxHeight;
	},
	mounted() {
		this.getSwiperMaxHeight(this, '#wedding');
	},
	methods: {
		checkObjLength(data) {
			if (typeof data == 'object') {
				if (checkObjLen(data)) {
					return true;
				} else {
					return false;
				}
			} else {
				return false;
			}
		}
	}
};
</script>

<style lang="less">
@import url('../../common.less');
</style>
